package com.huicharge.huichargecrm.exception;


import com.huicharge.huichargecrm.result.ResultCode;
import lombok.Getter;

/**
 * @author 鲁昊天
 * @date 2024/12/19
 */
@Getter
public class BusinessException extends RuntimeException  {
    /**
     * 错误码
     */
    private static final long serialVersionUID = 501603141096573858L;
    private final int code;

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ResultCode resultCode) {
        super(resultCode.getResultMsg());
        this.code = resultCode.getResultCode();
    }



}
